package kt.com.bilin.coin.api

import kt.com.bilin.coin.bean.*
import okhttp3.MultipartBody
import retrofit2.http.*

/**
 * Created by zhoucl
 * Description: 所有请求接口定义
 */
interface ApiService {

    @GET
    suspend fun dynamicUrl(@Url url: String?): String?

    /**
     * 上传文件
     */
    /*@POST("/api/user/upload")
    @Multipart
    suspend fun upload(
            @Body multipartBody: MultipartBody
    ): ResultBean<String?>*/
    @POST("/api/user/upload")
    suspend fun oldUpload(
            @Body file: MultipartBody,
    ): ResultBean<String?>

    @POST("/api/upload/img")
    suspend fun upload(
            @Body file: MultipartBody,
    ): ResultBean<String?>

    /**
     * 更新
     */
    @POST("/api/params/version")
    @FormUrlEncoded
    suspend fun appVersion(
            @Field("version") version: String,
            @Field("platform") platform: String = "android",
    ): ResultBean<AppVersionBean?>

    /**
     * 公安校验
     */
    @POST("/api/user/faceVerify")
    @Multipart
    suspend fun faceVerify(
            @Query("idCardNo") idCardNo: String,
            @Query("name") name: String,
            @Part file: MultipartBody.Part,
    ): ResultBean<String?>

    /**
     * 获取比领卷余额
     */
    @GET("/api/bl-wallet/getBlq")
    suspend fun getBlq(): ResultBean<BiLinAmountBean?>

    /**
     * 实名认证
     */
    @POST("/api/user/v2/kycAll")
    @FormUrlEncoded
    suspend fun kycAll(
            @Field("idCardNo") idCardNo: String,
            @Field("name") name: String,
            @Field("type") type: String,
            @Field("faceImg") faceImg: String?,
    ): ResultBean<String?>

    /**
     * 活体检测前校验
     */
    @POST("/api/user/v2/checkBefore")
    @FormUrlEncoded
    suspend fun kycCheckBefore(@Field("idCardNo") idCardNo: String, @Field("type") type: String): ResultBean<String?>

    /**
     * 提交意见反馈
     */
    @POST("/api/feedback/submit")
    @FormUrlEncoded
    suspend fun feedbackSubmit(@Field("content") content: String, @Field("img") img: String): ResultBean<String?>

    /**
     * 设置回复消息已读
     */
    @POST("/api/feedback/read/{id}")
    suspend fun updateUserMsgRead(@Path("id") id: Int): ResultBean<String?>

    /**
     * 分页查询回复列表
     */
    @GET("/api/feedback/replyList")
    suspend fun replyList(@Query("currentPage") currentPage: Int): ResultBean<PageBean<UserMsgBean>?>

    /**
     * APP通知弹窗
     */
    @POST("/api/notify/one")
    @FormUrlEncoded
    suspend fun notify(@Field("appId") appId: Int = 1100): ResultBean<NotifyBean?>

    /**
     * 获取系统参数
     */
    @GET("/api/user/gtpm")
    suspend fun appConfig(): ResultBean<AppConfigBean?>

    /**
     * app版本号
     */
    @POST("/api/params/version")
    @FormUrlEncoded
    suspend fun version(@Field("version") version: String, @Field("platform") platform: String = "android"): ResultBean<VersionBean?>

    /**
     * 首页轮播
     */
    @GET("/api/bl-banner/list")
    suspend fun banner(@Query("type") type: Int = 1): ResultBean<MutableList<BannerBean>?>

    /**
     * 首页通知
     */
    @GET("/api/bl-announce/list")
    suspend fun announce(@Query("currentPage") currentPage: Int = 1, @Query("pageSize") pageSize: Int = 3): ResultBean<PageBean<AnnounceBean>?>

    /**
     * 获取余额
     */
    @GET("/api/bl-wallet/getMoney")
    suspend fun getMoney(): ResultBean<MoneyBean?>

    @GET("/api/bl-dig/getStatus")
    suspend fun getStatus(): ResultBean<DigStatusBean?>

    @POST("/api/bl-dig/cat")
    @FormUrlEncoded
    suspend fun cat(@Field(SignInterceptor.PARAM) param: String = SignInterceptor.PARAM): ResultBean<String?>

    @POST("/api/bl-dig/dig")
    @FormUrlEncoded
    suspend fun dig(@Field(SignInterceptor.PARAM) param: String = SignInterceptor.PARAM): ResultBean<DigStatusBean?>

    @POST("/api/bl-dig/lookVideo")
    @FormUrlEncoded
    suspend fun lookVideo(@Field(SignInterceptor.PARAM) param: String = SignInterceptor.PARAM): ResultBean<String?>

    @GET("/api/bl-my-device/myDevice")
    suspend fun myDevice(
            @Query("currentPage") currentPage: Int = 1,
            @Query("type") type: Int,
            @Query("pageSize") pageSize: Int = 100,
    ): ResultBean<PageBean<MyMillBean>?>

    @POST("/api/bl-my-device/again")
    @FormUrlEncoded
    suspend fun again(@Field("id") id: String): ResultBean<String?>

    @POST("/api/bl-device/buy")
    @FormUrlEncoded
    suspend fun buy(@Field("id") id: String): ResultBean<String?>

    @GET("/api/bl-device/list")
    suspend fun deviceList(
            @Query("currentPage") currentPage: Int = 1,
            @Query("pageSize") pageSize: Int = 100,
    ): ResultBean<MutableList<MillResourceBean>?>

    @GET("/api/bl-ad-cz/getData")
    suspend fun getData(): ResultBean<CZTaskBean?>

    @POST("/api/bl-ad-cz/addTimes")
    @FormUrlEncoded
    suspend fun addTimes(@Field("type") type: String): ResultBean<String?>

    @GET("/api/user/session")
    suspend fun getSession(): ResultBean<UserInfoBean?>

    @POST("/api/user/logout")
    @FormUrlEncoded
    suspend fun logout(@Field(SignInterceptor.PARAM) param: String = SignInterceptor.PARAM): ResultBean<String?>

    @POST("/api/lottery/draw")
    @FormUrlEncoded
    suspend fun draw(@Field(SignInterceptor.PARAM) param: String = SignInterceptor.PARAM): ResultBean<LotteryAwardBean?>

    @GET("/api/lottery/gtnm")
    suspend fun gtnm(): ResultBean<LotteryNumBean?>

    @GET("/api/lottery/page")
    suspend fun lotteryPage(
            @Query("currentPage") currentPage: Int = 1,
            @Query("pageSize") pageSize: Int = 10,
    ): ResultBean<PageBean<LotteryBean>?>

    @GET("/api/cpl/getUrl")
    suspend fun cplGetUrl(
            @Query("deviceCode") deviceCode: String,
            @Query("xwdeviceid") xwdeviceid: String,
            @Query("ptype") ptype: Int = 2,
    ): ResultBean<MutableList<CplBean>?>

    @POST("/api/pay/recharge")
    @FormUrlEncoded
    suspend fun recharge(
            @Field("amount") amount: String,
            @Field("payType") payType: Int,
            @Field("phone") phone: String,
    ): ResultBean<String?>

    @GET("/api/user/getInviteMsg")
    suspend fun getInviteMsg(): ResultBean<InviteBean?>

    @GET("/api/pay/priceList")
    suspend fun priceList(): ResultBean<MutableList<String>?>

    @GET("/api/pay/recharge/countFee")
    suspend fun countFee(@Query("amount") amount: String, @Query("payType") payType: String = "1"): ResultBean<RechargeMoneyDetails?>

    @POST("/api/pay/telRecharge")
    @FormUrlEncoded
    suspend fun telRecharge(
            @Field("amount") amount: String,
            @Field("phone") phone: String,
            @Field("payType") payType: String = "1",
    ): ResultBean<String?>

    @GET("/api/pay/recharge/list")
    suspend fun rechargeList(
            @Query("currentPage") currentPage: Int = 1,
            @Query("pageSize") pageSize: Int = 10,
    ): ResultBean<PageBean<RechargeRecordBean>?>

    @GET("/api/read/appConf")
    suspend fun readAppConf(): ResultBean<String?>
}
